<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 15:22:10
 * @LastEditTime: 2023-09-02 12:21:26
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 兼容老接口数据
 */

namespace App\Http\Controllers\OldController;

use App\Http\Services\Storage\ProYarnService;
use App\Http\Services\System\UserService;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Laravel\Lumen\Routing\Controller as BaseController;

/**
 * 老系统兼容接口
 * @property ProYarnService $pro_yarn
 * @property UserService $service
 * @property User $user
 * @author sunkaiyuan
 */
class MenuController extends BaseController
    {

    public function __construct(UserService $service)
        {
        $this->service = $service;
        if (auth()->guard()->guest()) {
            fail('Unauthorized.', 401);
            }
        $this->user = auth()->user();
        }

    public function wxlist()
        {
        $condition = ["type_id" => 2];
        request()->merge(["filter" => [$condition]]);
        $data = $this->service->menu();
        return $data;
        }

    }